Move icon path detection into own class.