Merging it into my lib for convenience