Added tests and reduced code repetition. Updated Docs. Added test coverage for legacy names