Issues/6 modify app layer

backport #6 (including #349)