Starting to separate logic into separate classes.