Changed api, restructure