Added tests & refactored the project