Last code refactoring