Implement various small  functions