tidy up some interfaces and code