cleanup JS, create object instances