separate mask path function