Moving logic into methods.