Refactoring executable making and main functions.