added rails perf improvments