Refactored whole project