LUN-600 -- some refactorings