Added refactored source files and Makefile