Refactor to support loopback mobile template