Refactor of the cucumber steps

Some generic util functions have ben moved to an independent Object.