Refactored the initialization of a Context, resulting in much clearer code.