Clean up lockscreen shortcuts configuration code

Get rid of a lot of duplicated code.