Simplify(?) some string logic