Cleaning code; adding serialization of the trained data (model)