sam 0.5.0 - reorganize whole source code