simplificatino and refectoring