applied changes discussed in the PR