post refactoring with splits and command line mode