refactoring everything into nice modules