Make document ready function neater