ERT-781 Clean up of code