added translation as an abstraction layer, minor refactorings