some util methods and fixes