Refactored

Code has been refactored exhaustively. New classes and interfaces are
introduced for the sake of OOP.