TIMOB-16492-New PR with latest master-took care of review comments

https://jira.appcelerator.org/browse/TIMOB-16492