Moved definitions into separate named functions