This code is going to get reused so i made a util class