more alpha code refactoring