more reorganization and refactoring
yep, refactor again