Added user views in haml, moved general function to application controller