Refactoring
problems 4 & 5