Refactor core_test and adds a few cases to cover paths in methods