diseparate the engine and logic , make it runnable