fix unlock action, restructure function locations
include functions lib