Result type refactor