#6 #7 [FIX] Bug fix and code cleaning