reclassing and moving some code around