separate rectangle into util file