misc refactoring, prepare patch release