Refactor and expand functionality
Refactor and expand functionality