code refactor, created constants.h and mapper.c/.h