minor cleaning-up & refactroring