Wrote some tests, split big method