Optimization

Some small optimization issues