CLEANUP and improved the machanic