Hm.... still not understanding prototypes
Minor refactoring