Refactored for tutorial