Misc improvements in regards to performance