Refactored jvg function into library.