KRACOEUS-7002: Cleaned up code and adding missed functionality.