move commands into methods