completely refactored view functions with jQuery