Registration and db refactoring
Error path handlings