added parse_commands to pull sophistication away from if conditions