Removed Throws declarations in gateways and added tests for improved
test coverage and did some refactoring.