fix: game not finished when snake hits itself + code cleanup