clean up, add core functions