Collecting improvements on github

I have tried to collecting and merge improvements on github. 

Please review and merge!