major renaming and refactoring