refactor some helper functions
Start working on chess logic tests