Refines unit tests and implements league