added User search; other optimisation/cleanup