Refactor frontend adapter