trivival refactoring