refactoring deposit controller