code cleanup; fix regex bug; rename js file