Restructure Processing code and more comments