Production code refactoring