refactoring CodeField class