^ code cleanup & optimize