Refactor js on blog