Simplified JS init
Moved selectors into cache function