Implementation for #47