some install checks & code cleanup..