Main Classes completely rewritten