Cleanup and api change