WIP, move functions to seperate modules