refactore image