Refactoring of RoR code

according to ReSharper