Refactored and cleaned up project