make the base code general purpose and secure