checkpoint - half finished with refactor