move accounts-related code
add missing file from last commit