Remove redundant functions.
Use pytest in unit tests.