Refactor of previous code II