Refactoring frontend

idem2!