removed redundant code: implemented recursion
added Mapper extensions