re-architect code
add in feature to check url parameter