Fixed util methods and changed some structure