refac: extracted path creation to method invoked from onSizeChanged