refs #5: refactor to make the code cleaner
refs #5: used named kwargs