new approach inspired by the back-end

generate a separate method to enforce scoping
and allow easy inference of partially defined type