refactor regester models func