Refactoring, created gateway