add app error codes
refactoring
refactroing