moved things into methods