Implemented the last rule + refactoring
Refactoring