completely refactored the code to now use the value class "Mask" instead of the type alias Mask