frameworks: remove duplicate code

Change-Id: I7034a857904df3eb170341160407a6a859bc936c