refactored some code. changed project structure