Moved commands into methods.