bug fix/cleanup