Foundation init and cleanup