js functionality that I commonly reuse