presets code refactored