implement Lluis’ feedback on pull request