refactored; looks good