refactor for easy expansion/plugability