changed the way enter and exit works conforming MVC pattern