Refactor and add function to determine color