refactored types, registration and log now work