clean code, bug fix. todo: add game configuration support