minimal refactor