Code cleanup in utils and nsparser