Remove redundant main test code, add comments