adapted to hack-mvc