huge logic improvement, but this is just cleanup