javascript code extracted to a seprate file