Extract shared behavior