separating out more code