Refactor startup commands to simplify the flow
