Abstract the user interaction into class and interface

Abstract the user interaction into class and interface