Segregate code blocks into methods