removes hardcoded values, refactor
workaround for crash on window resize