Refactored for #2