Whole script was rewrited to PHP Light MVC and optimized