Started refactor of build system