Refactoring: better function prototypes