Reorganized functions

Improves readability for the important public functions