lib: set stuff in only one place
lib: cleanup