Clean up lockscreen target configuration code

Get rid of a lot of duplicated code.
Clean up lockscreen target configuration code: FIX