refactor prototypes