First refactoring, imgur code