a lot of changes to enhance performance!