Refactor implementation in better OOP.
Refactor to bettern OOP; introduced Policy, facotry; refactor exception checking point.