Updated app with cancan gem and refactored code