slightly cleaner code
first attempt at property support