Refactor code and change name of files