Re-facted code with OO design.