Improved current selection and removed useless code