window.setLocation & refactor api