Split target-related functions into separate class

Change-Id: I4a1235a1dca653bf42bab3d54ef7319c531e38f4