Refactoring source code - part 1