Cleaned up helper and added comments