Refactor javascript and css enqueueing