Code sorting, cleaning and some language changes