refactor: separating methods to be better to test.