extract handler to separate js files