move mask method to static to get around ClassManifest issue