more trial refactoring