Refactor for Loopback 2.x updates