Slight refactor and cleanup