refactored some code, little change in directory structure