Optimize

Optimize code for better efficiency and cleaner look