Put settings stuff in a function