Separate build logic from command line processing