clean some js semantics