[#11] refactored the methods and cleaned up the files