refactor pic_compile
clenaup debug message format
remove redundant message
staticize compile function