Move basic setup to the top and condense it