refactored resultcodes to constants