Make some beauty in code and fixing bugs in syntax

@tadatuta @sipayRT