copied classes form bf demo project