We should find an existing library for this
We should find an existing library for this