factor out commands to commands.rb