used helper to get rid of redundancies