Separating the Lambda handler (entry point) from the core logic allows you to make a more unit-testable function. In Node.js this may look like:
exports.myHandler = function(event, context, callback) {
var foo = event.foo;
var bar = event.bar;
var result = MyLambdaFunction (foo, bar);
callback(null, result);
}
function MyLambdaFunction (foo, bar) {
// MyLambdaFunction logic here
}