Cleaned up testing code, split into fixture