Further restructuring, registering added - untested