Added rebuild functionality.