restructured source code by dividing it into several class files