trim input from text, adapt commands to use new format