refactor to get ready for new version