refactor some leg player related code
rm some more JS code