Make the code more modular so the user can later modify the swatch