before database stuff