Starting code cleaning to separate into more classes