masks: unify mask creation process

Pretty cool stuff