reduce number of http requests
code cleanup