Refactored some code and folder structure