Refactoring and makefile