refactored to create Machine sprt class
refactoring