updated with improvments from artsy production version
mergin