Started introducing another level of typesafety. Currently everything is
broken.