updated for MVC use