Some changes to move things around and fix generics <> problems and data
access types