Refactor portfolio widget