Refactoring obsolete code