refactor directory structure to fix build issues (thanks Ben)