finish tidying up the formcontext code in preparation for integration into the main codebase