migrating code to upper abstraction