Advice on a style issue(writing funcions)