Further machine add refactoring. Also fix scroll to top issue when clicking collapsibles