clean up and port our JS