Reorganize and expand functionality