huge refactoring with localization re-design and test coverage 05012013