API cleanup by starting moving some code to a trait