updated according to review comments

Sorry for creating a new pull request, but last one was copy pasted in to github (from another project)