refactoring for different resolutions