moved some variable declarations to library