introducing ruler, better handling of focus and mod extraction