Big rewrite. And due to backward compitibility, I merged them back
delete core