package refactor and implemented account validation and insert

some other little fix