makefile refactor