Moved id file creation to a more appropriate place