abstracted out the actor into it's own js struct