Light functionality code refactoring (part 2)