working same as master, refactored
working same as master, refactored


Former-commit-id: fbca75517cc321942969cf4d126d260c1930897a
karel-brinda/prophyle,karel-brinda/prophyle,karel-brinda/prophyle,karel-brinda/prophyle