Code refactoring in line with guidelines