js helper functions to eventually integrate