futher refactoring/organization