refactor code

Seperate frontend, backend, and control panel