updated crreate method. refactored duplicate code