refactored according with mentor's advices