Better solution for applying focus