Remove warning and making the class more generic