Split main class into other classes.