Code clean-up & improvements