FLOE-231: Fixed the code duplication.