refactoring
refactored program to some really small and simple classes