Added shutdown hook, moved subclasses into their own files