refactoring paybox controller