flipped out more functionality into methods