No worries :) You're right that the law shouldn't be arbitrary. Lots of what the law is applied only when a cases passes legal tests to determine if some conduct violates the law. These tests are applied the same way to everybody and are thus impartial. Naturally, there's lots of debate and research into which legal tests we should use, and what their substance is.