Refactor  core class structure