refactor func

refactor registerModel func