Add util functions and lint fixes