Refactoring, started on image receiving