Refactor everything to use Result