Performance tuning and added a rake task in progress.
Fixed conflicts