broke stuff out into methods