big reorganization of file structure and refactor