fix tableGateway featurest leak
code cleanup