mass refactory
changed core