Several additions and cleanup