LUN-368 -- small code refactor