tidy up these functions