major code cleanup. refactored static mapping classes to instance classes