Integrate Global "from" option; reorganize code