[full source code refactor] new mask parser/builder