Rewrite to behave better