moving some code for field theming