[TAC-156] algo improvment - max size def / first positioning - refactoring 5