registraction fix, refeactoring