Questions requesting a review of working code should be asked at the Code Review Stack Exchange
When using this tag you should consider posting your question to the Code Review Stack Exchange instead because code reviews are considered off-topic for GIS SE - see http://meta.gis.stackexchange.com/questions/317/code-review-for-a-specific-piece-of-code