Cleaned up jquery code