refactored to be more jQuery looking