LOADUI-458 refactored away some ugly code based on code-review