moved controller logic for registration to service object
corrected variables to instance variables