refactor and improved mechaniX