Move setting fields visibility to separate function.
Move getting of fieldParent to separate function.