Ported code to use Revel