refactors, updated to run on lockscreen