Code cleanup, additional comments etc.