reworked the logic for inserting a user, and totally devided logic from design