make inner class static and add a `forField` method