IDI-104: Refactoring to improve code.