In the Ritsuryo system (a system of centralized government based on the ritsuryo code), the term kaieki referred to removing someone from their current post and appointing someone new to that position.
改易（かいえき）とは、律令制度では現職者の任を解き新任者を補任することをいう。