maybe it's better to divide this methods in several smaller methods so you can see what is tested