- rearranging some logic