Also, isn't this way of doing it a bit of a security risk, effectively allowing another app to call any method in this app? Should this be a switch statement instead?