major refactor to fix #4 and to facilitate future react changes by spliting the public api from the wrapper api