remove depr functions and tidy ups