Revert "Attempt to simplify js"

This reverts commit f97e7535b71da6b1cbb50913cbbfdf95d20abac4.