Code clean, performance improvements