added byline logic
code refactored