Refactor styles, bunch of state-related stuff