refactored for better look