extract commonly used constants
small fixes