code cleanup
pending until fix the rest