code cleanup & format