refactor (KISS): Javascript