refactored registration
improved registration, adjusted to new API