Merged the three setSizes by using a new class