Code organization

Just some tidying
Fixed a singleton warning