improve focus behaviour, remove some old cruft