userbackend refactoring and hooks preparation