fixed some rails best practices errors