code refactoring and removing unnecessary images