photo refactoring