Refactoring PID-controller