refactor and build executable