break up logic into methods