Nausea code refactoring