Cleanup & format code