Organizing code, minor fixes and checking for optimization