separate java script code