optimized a bit of element init and select handling