moving actions to router
closing detail by a click