cleanup and removed all obsolete layers