moving javascript out of view. refactoring section params