made role enum based and move res to one place