LUN-1544: Some small refactoring