Code cleanning and commenting