refactor: main method
refactor: extracted result processing