finished util methods for parser