refactor core as a header and src. client is a library.