Restructure and seperate frontend from backend