Cleaned up syntax to be more rails 4 friendly.