refactored wallpaper code