Added some more structure and glue