Updated to manage the 3 types