refactor config and add window size