moved the parameter extraction to its own method