Splitted code to proper classes