Add util methods and slightly refactor