Some optimizing done and what not