introduced some sort of persistant type context

will have to be changed into a session variable if possible.