adding microposts helper and collapsed repeated code in users controller