Added helper functions and renamed some stuff