code cleanup

close #124