code cleanup + add more description