image refactor