refactoring for better testing
created extractor for testing the commands