Seperated core functionality into own module