externalizes logic (prep for "pluginizing" it)