Rewrite orginal version with more OO approach