refactor and major changes
refactor core
refactor model and math