Minor refactor, improved function names