minor bug fix + cleanup