Refactoring for better retina support