removed commons dependency, cleaned up code, added better abstraction