Refactor: Moved inline pre handling code for list element to a class