Minor refactoring
put command getting close to working