Refactor css parsing into variables to a new function