Defining capabilities and contracts