Refactoring Adapter and add Command pattern